

<%@ page import="mms.MedicineCompany" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'medicineCompany.label', default: 'MedicineCompany')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
        <js:thickbox/>
        <js:jgrowl/>
        <js:ajaxupload/>
        <g:javascript src="medicineCompany/editgis.js" />

    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${medicineCompanyInstance}">
            <div class="errors">
                <g:renderErrors bean="${medicineCompanyInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${medicineCompanyInstance?.id}" />
                <g:hiddenField name="version" value="${medicineCompanyInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="name"><g:message code="medicineCompany.name.label" default="Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: medicineCompanyInstance, field: 'name', 'errors')}">
                                    <g:hiddenField name="name" value="${medicineCompanyInstance?.name}" />${medicineCompanyInstance?.name}
                                </td> 
                            </tr>
                          
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="gis"><g:message code="medicineCompany.gis.label" default="Gis" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: medicineCompanyInstance, field: 'gis', 'errors')}">
                                    <a href="javascript:" id="searchGIS"><img src="${resource(dir:'images',file:'search.png')}"  alt="search" border="0" /></a>
                                    <g:hiddenField name="gis" value="${medicineCompanyInstance?.gis}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="latitude"><g:message code="medicineCompany.latitude.label" default="Latitude" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: medicineCompanyInstance, field: 'latitude', 'errors')}">
                                    <g:textField name="latitude" value="${medicineCompanyInstance?.latitude}" readonly="true"/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="longitude"><g:message code="medicineCompany.longitude.label" default="Longitude" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: medicineCompanyInstance, field: 'longitude', 'errors')}">
                                    <g:textField name="longitude" value="${medicineCompanyInstance?.longitude}"  readonly="true"/>
                                </td>
                            </tr>
                            
                             <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="longitude"><g:message code="medicineCompany.live.label" default="live" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: medicineCompanyInstance, field: 'live', 'errors')}">
                                    <g:textField name="live" value="${medicineCompanyInstance?.live}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="apothecary"><g:message code="medicineCompany.apothecary.label" default="Apothecary" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: medicineCompanyInstance, field: 'apothecary', 'errors')}">
                                    
                                   <div id="apothecarySpace">
                                       <g:each in="${medicineCompanyInstance.apothecary}" var="m">
                                          ${m} 
									  </g:each>
                                      </div>
                                <a href="javascript:" id="createApothecary"><img src="${resource(dir:'images',file:'add.png')}"  alt="add" border="0" /></a> 
                                <a href="javascript:" id="searchApothecary"><img src="${resource(dir:'images',file:'search.png')}"  alt="search" border="0" /></a> 

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="employees"><g:message code="medicineCompany.employees.label" default="Employees" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: medicineCompanyInstance, field: 'employees', 'errors')}">
                                    <div id="employeesSpace">
                                       <g:each in="${medicineCompanyInstance.employees}" var="m">
                                          ${m} 
									  </g:each>
                                      </div>
                                <a href="javascript:" id="createEmployees"><img src="${resource(dir:'images',file:'add.png')}"  alt="add" border="0" /></a> 
                                <a href="javascript:" id="searchEmployees"><img src="${resource(dir:'images',file:'search.png')}"  alt="search" border="0" /></a> 
                                 

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="history"><g:message code="medicineCompany.history.label" default="History" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: medicineCompanyInstance, field: 'history', 'errors')}">
                                     <g:each in="${medicineCompanyInstance.history}" var="m">
                                     <g:textArea name="history" cols="40" rows="5"  value="${m}"/>
									  </g:each>
                                <g:textArea name="history" cols="40" rows="5"  value=""/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="improper"><g:message code="medicineCompany.improper.label" default="Improper" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: medicineCompanyInstance, field: 'improper', 'errors')}">
                                     <g:each in="${medicineCompanyInstance.improper}" var="m">
                                     <g:textArea name="improper" cols="40" rows="5"  value="${m}"/>
									  
                                </g:each>
                                <g:textArea name="improper" cols="40" rows="5"  value=""/>
                                </td>
                            </tr>
                        
                              <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="multimedia"><g:message code="medicineCompany.multimedia.label" default="multimedia" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: medicineCompanyInstance, field: 'multimedia', 'errors')}">
                                 <input type="hidden" name="file">
                                <input type="button" name="upload" id="upload" value="上传图片">
                                 <div id="multimediafile" class="multimediaSpace">
                                 <g:each in="${medicineCompanyInstance.multimedia?.findAll{it.mediaType=='picture'}}" var="m">
                                    <div> 
									<img src="${m.preview}" border=0 alt="img" class="picture"  value='${m.id}'><input type='hidden' name='multimedia' value='${m.id}'>
                                    </div> 
                                </g:each>
                                </div> 
                                </td>
                            </tr>
 

                               <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="multimedia"><g:message code="medicineCompany.multimedia.label" default="multimedia" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: medicineCompanyInstance, field: 'multimedia', 'errors')}">
                                 <input type="hidden" name="file">
                                <input type="button" name="uploadmovie" target="movie" id="uploadmovie" value="上传视频">
                                 <div id="moviefile" class="multimediaSpace">
                                 <g:each in="${medicineCompanyInstance.multimedia?.findAll{it.mediaType=='video'}}" var="m">
                                    <div> 
									<img src="${m.preview}" border=0 alt="img" class="video" value='${m.id}'><input type='hidden' name='multimedia' value='${m.id}'>
                                    </div> 
                                </g:each>
                                </div> 
                                </td>
                            </tr>

                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                 </div>
            </g:form>
        </div>
    </body>
</html>
